Skip to content

kboot: disable WFI/WFIT where it loses state (from AsahiLinux/m1n1) - #18

Open
hishamMounir wants to merge 2 commits into
GravityLinux:mainfrom
hishamMounir:asahi/wfi-bootargs
Open

hishamMounir wants to merge 2 commits into
GravityLinux:mainfrom
hishamMounir:asahi/wfi-bootargs

Conversation

@hishamMounir

Copy link
Copy Markdown

This ports two AsahiLinux/m1n1 commits by Yureka, unchanged. The original authorship is kept, and -x records where each came from.

  • kboot: disable wfi/wfit if wfi loses state (AsahiLinux/m1n1 3a69c73f)
  • kboot: fix inverted wfi bootargs condition (AsahiLinux/m1n1 9095a5ee)

On locked M4-class and later machines, a CPU loses architectural state in WFI and WFIT. These commits make kboot append idle=nop arm64.nowfxt to the kernel command line on those machines, so Linux avoids both in its idle loop and delay function. Gravity's kernel already has the arm64.nowfxt override, but nothing passes it today.

Why it matters on the M5 (J704, T8142)

Tested on a J704 by chainloading this tree into RAM and booting a Linux 7.1 Asahi kernel with the daily DT and root on the SSD.

Without these commits, booting Gravity's bootloader with the T8142 series:

  • One boot hung at 0.86 s.
  • Another reached userspace and then froze about 2 minutes later: black screen, no reply over USB or Wi-Fi.

With the two arguments passed by hand, every tree booted and stayed up for the 5-minute check.

With these commits (on top of the T8142 core series and #14, nothing passed by hand):

  • m1n1 prints FDT: appending to bootargs: idle=nop arm64.nowfxt.
  • The kernel command line ends with those two arguments.
  • The machine passed the same 5-minute check.

Testing

  • Builds and links with clang and the Rust target on current main.
  • Hardware result: see above (J704, macOS 26.6.2 iBoot, mBoot-20457.41.3).

🤖 Generated with Claude Code

Signed-off-by: Yureka <yureka@cyberchaos.dev>
(cherry picked from commit 3a69c73f59332b7b617835fd9a1c49dc89edcfd2)
Signed-off-by: Yureka <yureka@cyberchaos.dev>
(cherry picked from commit 9095a5ee70bf7ad970d9759ebc6fb6842b7def32)
@ADevWithAnIdea

Copy link
Copy Markdown
Member

Squash this into one commit and then this can be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants